package cc.htdf.gwc.datacompare.service;

import cc.htdf.gwc.datacompare.domain.response.ResponseBody;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by JT on 2017/10/11.
 */
@FeignClient("gwc-service-forecast")
public interface ForecaseDataService {

    @GetMapping("/data/ChengDu/score")
    ResponseBody fetchChengDuForecast(@RequestParam("stations") String stations,
                                      @RequestParam("elements") String elements,
                                      @RequestParam("modelRunDateTime") String modelRunDateTime,
                                      @RequestParam("validTimes") String validTimes);

    /**
     * 根据站号、要素、预报时间查询数据
     * @param stations：站号
     * @param elements：要素
     * @param validDate：预报时间
     * @return
     */
    @GetMapping("/data/ChengDu/validDate")
    ResponseBody fetchForcastDataByValidDate(@RequestParam("stations") String stations,
                                             @RequestParam("elements") String elements,
                                             @RequestParam("validDate") String validDate);


    @GetMapping("/data/ChengDu/validTimeRange")
    @CrossOrigin
    ResponseBody fetchDataByModelRunDateTimeAndValidTimes(@RequestParam("stations") String stations,
                                                          @RequestParam("elements") String elements,
                                                          @RequestParam("modelRunDateTime") String modelRunDateTime,
                                                          @RequestParam("startValidTime") String startValidTime,
                                                          @RequestParam("endValidTime") String endValidTime);


    /**
     * 根据台站号、要素、发布小时，预报时次数查询数据
     * @param station：站号
     * @param elemtns：要素
     * @param hour：发布小时 HH
     * @param times：预报的时次，例如：前12小时：12， 前24小时：24
     * @return
     */
    @GetMapping("/data/ChengDu/{station}")
    @CrossOrigin
    ResponseBody fetchDataByStationAndModelHourAndValidTimes(@PathVariable("station") String station,
                                                             @RequestParam("elements") String elemtns,
                                                             @RequestParam("modelhour") String hour,
                                                             @RequestParam("times") String times);
}
